package com.byxy.demo2.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.byxy.demo2.dao.UserDao;
import com.byxy.demo2.entity.User;
import com.byxy.demo2.service.UserService;

@Service
@Transactional
public class UserServiceimpl implements UserService {
	@Autowired
	private UserDao userdao;
	@Override
	public User getByNameAndPassword(String userName, String userPassword) {
		// TODO Auto-generated method stub
		return userdao.getByNameAndPassword(userName,userPassword);
	}
	@Override
	public void save(String userName, String userNick, String userPassword, Integer userType) {
		User u=new User();
		u.setUserName(userName);
		u.setUserNick(userNick);
		u.setUserPassword(userPassword);
		u.setUserType(userType);
		 userdao.save(u);
		
	}

	

}
